check for need of signing TOS during connectivity check
authorJyrki Gadinger <nilsding@nilsding.org>
Tue, 18 Feb 2025 12:12:38 +0000 (13:12 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 20 Feb 2025 11:01:07 +0000 (12:01 +0100)
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/accountstate.cpp
src/gui/accountstate.h

index d167f76f87ec315982fadd6a5c9434e7af74b861..a59fed273175069475b4de511d1b70d76ae29384 100644 (file)
@@ -222,6 +222,11 @@ bool AccountState::isConnected() const
     return _state == Connected;
 }
 
+bool AccountState::needsToSignTermsOfService() const
+{
+    return _state == NeedToSignTermsOfService;
+}
+
 void AccountState::tagLastSuccessfullETagRequest(const QDateTime &tp)
 {
     _timeOfLastETagCheck = tp;
@@ -316,7 +321,7 @@ void AccountState::checkConnectivity()
     _connectionErrors.clear();
     connect(conValidator, &ConnectionValidator::connectionResult,
         this, &AccountState::slotConnectionValidatorResult);
-    if (isConnected()) {
+    if (isConnected() || needsToSignTermsOfService()) {
         // Use a small authed propfind as a minimal ping when we're
         // already connected.
         conValidator->checkAuthentication();
index de4311dbe605967e0c7f20e1a6b47e0c6d443132..0d52f77873bf19a9b83571185f37bb0c46901e33 100644 (file)
@@ -127,6 +127,8 @@ public:
 
     bool isConnected() const;
 
+    bool needsToSignTermsOfService() const;
+
     /** Returns a new settings object for this account, already in the right groups. */
     std::unique_ptr<QSettings> settings();